package com.gml.design.other.strategy;

/**
 * @ClassName : Cat
 * @Description :
 * @Author : gml
 * @Date: 2021-04-02 16:41
 */
public class Cat implements Comparable<Cat>{

    private int width;

    private int high;

    public Cat(int width, int high) {
        this.width = width;
        this.high = high;
    }

    public int getWidth() {
        return width;
    }

    public int getHigh() {
        return high;
    }

    @Override
    public int compareTo(Cat cat) {
        if (this.width < cat.getWidth()) return -1;
        else if (this.width > cat.getWidth()) return 1;
        else return 0;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "width=" + width +
                ", high=" + high +
                '}';
    }
}
